// Printing a drawing
// This is a very simple demo of how to use the Print Manager to
// print a drawing.
// Assumes inclusion of
#include <PrintTraps.h>
void ToolBoxInit(void);
void ToolBoxInit ()
{
}
{
PrOpenPage( printPort, nil); // Open this page ... // ---------
DrawPicture( whichPic, whichDestRect); // Or any other drawing // commands ...
// ---------
// Handle print spooler
if (((*hPrint)->prJob.bJDocLoop = bSpoolLoop) && (!PrError() ) ) }
}
void main ()
{
scratchRect;
short i;
ToolBoxInit();
SetRect(& drawingRect, 40, 40, 300, 300); myPict = OpenPicture(& drawingRect); // 'Open' a picture // --------- Do your drawing here ...
SetRect(&scratchRect, 50, 50, 200, 200); for (i = 0; i < 10; i++) {
}
// --------- After your drawing is finished
HidePen(); // So closing the picture will make the pen visible PrintPicture(myPict, & drawingRect); // This will print our drawing
}